#ifndef STATSSTATE_H
#define STATSSTATE_H
#include "Button.h"
#include "State.h"
#include <fstream>


class StatsState : public sfge::State
{
    public:
        void init();
        void cleanup();

        void handle();
        void update();
        void draw();
        void resume(){};
        void pause(){};

        static StatsState* Instance(sf::RenderWindow* window, sfge::StateManager* mgr)
       	{
       	    if(statsState == NULL)
                statsState = new StatsState(window, mgr);
            return statsState;
        }

    private:
        StatsState(sf::RenderWindow* window, sfge::StateManager* mgr);
        ~StatsState();

        void readStats();
        void initSprites();
        void checkButtons(float x, float y);
        void clicked(float x, float y);
        sf::Sprite background;
        sf::Sprite cursorSprite;
        Button* backButton;
        std::vector<sf::Text> scores;
        std::vector<sf::Sprite> sprites;
        sf::Text livesLostText;
        sf::Text timePlayedText;
        sf::Text highscoreText;
        sf::Font mfont;

        static StatsState* statsState;
};

#endif // STATSSTATE_H
